<?php
namespace app\pub\util;

class Random
{
    const NUMBER = '0123456789';

    public function __construct(){}

    // 用户注册盐
    static public function userSalt($len = 6){
        $arr = str_split(self::NUMBER);
        for ($i=0; $i < $len; $i++) { 
            shuffle($arr);
            $key = rand(0,count($arr)-1);
            $arr_new[] = $arr[$key];
        }
        return join('',$arr_new);
    }
}
